package com.ruoyi.carousel.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.carousel.mapper.XlkjCarouselMapper;
import com.ruoyi.carousel.domain.XlkjCarousel;
import com.ruoyi.carousel.service.IXlkjCarouselService;

/**
 * 轮播图Service业务层处理
 * 
 * @author wnag
 * @date 2022-01-14
 */
@Service
public class XlkjCarouselServiceImpl implements IXlkjCarouselService 
{
    @Autowired
    private XlkjCarouselMapper xlkjCarouselMapper;

    /**
     * 查询轮播图
     * 
     * @param id 轮播图主键
     * @return 轮播图
     */
    @Override
    public XlkjCarousel selectXlkjCarouselById(Long id)
    {
        return xlkjCarouselMapper.selectXlkjCarouselById(id);
    }

    /**
     * 查询轮播图列表
     * 
     * @param xlkjCarousel 轮播图
     * @return 轮播图
     */
    @Override
    public List<XlkjCarousel> selectXlkjCarouselList(XlkjCarousel xlkjCarousel)
    {
        return xlkjCarouselMapper.selectXlkjCarouselList(xlkjCarousel);
    }

    /**
     * 新增轮播图
     * 
     * @param xlkjCarousel 轮播图
     * @return 结果
     */
    @Override
    public int insertXlkjCarousel(XlkjCarousel xlkjCarousel)
    {
        xlkjCarousel.setCreateTime(DateUtils.getNowDate());
        return xlkjCarouselMapper.insertXlkjCarousel(xlkjCarousel);
    }

    /**
     * 修改轮播图
     * 
     * @param xlkjCarousel 轮播图
     * @return 结果
     */
    @Override
    public int updateXlkjCarousel(XlkjCarousel xlkjCarousel)
    {
        xlkjCarousel.setUpdateTime(DateUtils.getNowDate());
        return xlkjCarouselMapper.updateXlkjCarousel(xlkjCarousel);
    }

    /**
     * 批量删除轮播图
     * 
     * @param ids 需要删除的轮播图主键
     * @return 结果
     */
    @Override
    public int deleteXlkjCarouselByIds(Long[] ids)
    {
        return xlkjCarouselMapper.deleteXlkjCarouselByIds(ids);
    }

    /**
     * 删除轮播图信息
     * 
     * @param id 轮播图主键
     * @return 结果
     */
    @Override
    public int deleteXlkjCarouselById(Long id)
    {
        return xlkjCarouselMapper.deleteXlkjCarouselById(id);
    }
}
